Repository navigation
fix(mcpx): bound sdnotify socket sends - #6176
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ce9151f6f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if conn.writeDeadline.Before(started) || conn.writeDeadline.After(started.Add(timeout+time.Millisecond)) { | ||
| t.Fatalf("write deadline = %s, want it within %s of send start", conn.writeDeadline, timeout) |
There was a problem hiding this comment.
Remove the one-millisecond scheduling assumption from the deadline test
On a loaded CI worker, a scheduling pause of more than one millisecond between recording started and setting the write deadline makes this assertion fail even when sendWithDialer behaves correctly: the implementation computes its deadline from the time after dialing, not from started. This introduces a flaky failure into the suite this change is intended to stabilize. Capture timestamps around the call and check that the recorded deadline falls within those bounds plus timeout, rather than assuming setup finishes within one millisecond. The scoped testing guidance requires fixing or explicitly quarantining flakes.
AGENTS.md reference: pkgs/mcpx/internal/AGENTS.md:L13-L14
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 9e64917 (task 14033, lane any-d): TestSendWriteHasDeadline now captures finished after the call and asserts the deadline falls in [started+timeout, finished+timeout], so no fixed 1ms scheduling assumption remains. Verified: go test ./internal/sdnotify/ -count=1 passes and the two deadline tests pass at -count=50.
Picked up — task 14033, shepherd PR #6176Lane any-d claimed task 14033. Fresh verification: PR #6176 is OPEN, head 7ce9151, no labels (no held / user/owned / do-not-merge / do-not-auto-edit). The fix is not on main (main still dials unbounded). One Codex P2 finding is open: the write-deadline test in sdnotify_test.go assumes setup finishes within 1ms and can flake on a loaded worker. Plan: rebase the single commit onto current main in worktree ~/git/fleet/queue-14033-6176-sdnotify, fix the Codex finding by bounding the deadline assertion with timestamps captured around the call, run the sdnotify package tests, push to the PR branch, and merge when verified. |
7ce9151 to
9e64917
Compare
Parked (CI wait) — task 14033, PR #6176Lane any-d shepherded PR #6176: rebased its single commit onto current main (6741fc5) resolving the sdnotify.go close-form conflict, fixed the open Codex P2 finding (write-deadline test no longer assumes 1ms scheduling slack; assertion bounded by timestamps captured around the call — reply posted on the Codex thread), and pushed head 9e64917. Local verification: go test ./internal/sdnotify/ -count=1 passes (all 8 tests), deadline tests pass at -count=50, go vet and gofmt clean. CI at park time: relevant checks PASS (mcpx-test lint, mcpx-test plugin-ts, mcpx-test init, mcpx fix carries a test, mcpx affected-embed regressions, spec parity, production line limit, proxy fallbacks). Still PENDING: mcpx-test unit + e2e shards, nix build, stress PR changed tests. FAILING in areas this PR does not touch (diff is only pkgs/mcpx/internal/sdnotify/*.go; the branch is current main plus those two commits): aggregator/projector python suites (claimant install .bun write), fleet-search parity, basic lint, plugin sync check. Parking task 14033 as a CI wait on PR #6176. Resume: when the pending mcpx/nix checks complete, merge PR #6176 if the pending checks pass or fail only as they do on main, then complete task 14033 as fixed_merged and close the loop on issue #5428 if it applies. Worktree: ~/git/fleet/queue-14033-6176-sdnotify (branch queue/14033-6176-sdnotify-work, head 9e64917). |
|
Shepherded to merge (task 14033, lane any-b, 2026-11-13).
|
Summary
Fixes #5428. Bound
sdnotify.Senddial and write operations to one second, so an unresponsive notify socket cannot stall the test suite indefinitely. The abstract-socket test skips only for Linux abstract-socket unavailability or timeout; it still verifiesREADY=1on hosts where abstract datagrams work. Added bounded-dial/write and unsupported-error classification tests.Evidence
TestAbstractSocketNamepassed; reported fleet-build run 41819578987 hung inReady/Sendfor 1800.070s.After:
go test ./internal/sdnotify -count=1 -timeout=30s,go test ./internal/sdnotify -race -shuffle=on -count=5 -timeout=60s, andgo vet ./internal/sdnotifypass locally. The abstract-socket hang has not been reproduced outside the fleet-build environment.Merge Danger
Door: two-way
Blast Radius: narrow
Only mcpx systemd notification socket operations and their tests change; socket path, payload, and caller behavior are unchanged except for bounded errors.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.